<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
	<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@include file="common.jsp"%>
<link media="screen" rel="stylesheet" href="css/maintance.css"/>

  <script language="JavaScript" type="text/javascript">
  var   intervalID=0; 
  function getinfo() { 

	  $('#status').html("Refreshing...");
	  	  
      jQuery.ajax( {  
        type : 'GET',  
        contentType : 'application/json',  
        url : '/iHome/info.html',  
        dataType : 'json',  
        success : function(data) {  
          if (data) { 
        	  $('#info').html(
                	  "cpu load%: " + data.cpuRatio + "<br/>" +
                      "TotalMemory: " + data.totalMemory + "<br/>" +
                      "FreeMemory: " + data.freeMemory + "<br/>" +
                      "MaxMemory: " + data.maxMemory + "<br/>" +
                      "OS: " + data.osName + "<br/>" +
                      "TotalMemorySize: " + data.totalMemorySize + "<br/>" +
                      "FreePhysicalMemorySize: " + data.freePhysicalMemorySize + "<br/>" +
                      "UsedMemory: " + data.usedMemory + "<br/>" +
                      "TotalThread: " + data.totalThread + "<br/>"  
                      );  
        	  $('#status').html("Finihsed");
          }  
        },  
        error : function() {  
          alert("error"); 
        }  
      });
  }
  function autoRefresh(){  
	  intervalID = setInterval(getinfo,1000);
  }
  function stopAuto(){  
	  clearInterval(intervalID); 
  }
  </script>  
<title>Maintanence</title>
</head>
<body>
	<div id="menu3">
		<ul>
			<!-- CSS Tabs -->
			<li><a href="Home.html">Home</a>
			</li>
			<li><a id="current" href="maintanence.html">maintanence</a>
			</li>
			<li><a href="photes.html">Photes</a>
			</li>
			<li><a href="videos.html">Videos</a>
		</ul>
	</div>
	<div id="status"></div>
	<div id="info"></div>
	<input id="refreshBtn" type="button" value="Refresh Now!" onclick="getinfo();"/>
	<input id="startAutoRefresh" type="button" value="Auto Refresh!" onclick="autoRefresh();"/>
	<input id="stopAutoRefresh" type="button" value="Stop Refresh!" onclick="stopAuto();"/> 
</body>
</html>